/* 
 * File:   DescriptorTest.cpp
 * Author: max
 *
 * Created on Apr 6, 2013, 4:45:14 PM
 */

#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <fstream>

#include "Descriptor.h"
#include "Processor.h"

using namespace std;
using namespace TP3::Mangling;
using namespace TP3::Working;
/*
 * Simple C++ Test Suite
 */

void test1() {
    std::cout << "DescriptorTest test E1" << std::endl;
    try
    {

        string rules = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E1/reglas.txt";
        string input = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E1/in.txt";
        string output = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E1/out.txt";
        
        Processor processor (rules.c_str(), input.c_str(), output.c_str());
        processor.Process();
        
    }
    catch (int ex)
    {
        std::cout << "%TEST_FAILED% time=0 testname=test2 (DescriptorTest) message= error code " << ex << std::endl;
    }
    
}

void test2() {
    std::cout << "DescriptorTest test E2" << std::endl;
    try
    {
        

        
        string rules = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E2/reglas.txt";
        string input = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E2/in.txt";
        string output = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E2/out.txt";
        
        Processor processor (rules.c_str(), input.c_str(), output.c_str());
        processor.Process();
        
    }
    catch (int ex)
    {
        std::cout << "%TEST_FAILED% time=0 testname=test2 (DescriptorTest) message= error code " << ex << std::endl;
    }
    
}
void test3() {
    std::cout << "DescriptorTest test E3" << std::endl;
    try
    {
        string rules = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E3/reglas.txt";
        string input = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E3/in.txt";
        string output = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E3/out.txt";
        
        //Processor processor (rules.c_str(), "-", "-");
        Processor processor (rules.c_str(), input.c_str(), output.c_str());
        processor.Process();
        
    }
    catch (int ex)
    {
        std::cout << "%TEST_FAILED% time=0 testname=test3 (DescriptorTest) message= error code " << ex << std::endl;
    }
    
}
void test4() {
    std::cout << "DescriptorTest test E4" << std::endl;
    try
    {
        string rules = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E4/reglas.txt";
        string input = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E4/in.txt";
        string output = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E4/out.txt";
        
        //Processor processor (rules.c_str(), "-", "-");
        Processor processor (rules.c_str(), input.c_str(), output.c_str());
        processor.Process();
        
    }
    catch (int ex)
    {
        std::cout << "%TEST_FAILED% time=0 testname=test4 (DescriptorTest) message= error code " << ex << std::endl;
    }
    
}
void test5() {
    std::cout << "DescriptorTest test E5" << std::endl;
    try
    {
        string rules = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E5/reglas.txt";
        string input = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E5/in.txt";
        string output = "/home/maximiliano/FIUBA/75.42.TP3.2013.1/Tests/E5/out.txt";
        
        //Processor processor (rules.c_str(), "-", "-");
        Processor processor (rules.c_str(), input.c_str(), output.c_str());
        processor.Process();
        
    }
    catch (int ex)
    {
        std::cout << "%TEST_FAILED% time=0 testname=test5 (DescriptorTest) message= error code " << ex << std::endl;
    }
    
}

int main(int argc, char** argv) {
    std::cout << "%SUITE_STARTING% DescriptorTest" << std::endl;
    std::cout << "%SUITE_STARTED%" << std::endl;
/*
    std::cout << "%TEST_STARTED% test1 (DescriptorTest)" << std::endl;
    test1();
    std::cout << "%TEST_FINISHED% time=0 test1 (DescriptorTest)" << std::endl;
*/
    std::cout << "%TEST_STARTED% test2 (DescriptorTest)\n" << std::endl;
    test2();
    std::cout << "%TEST_FINISHED% time=0 test2 (DescriptorTest)" << std::endl;
    /*
    std::cout << "%TEST_STARTED% test3 (DescriptorTest)\n" << std::endl;
    test3();
    std::cout << "%TEST_FINISHED% time=0 test3 (DescriptorTest)" << std::endl;
    
    std::cout << "%TEST_STARTED% test4 (DescriptorTest)\n" << std::endl;
    test4();
    std::cout << "%TEST_FINISHED% time=0 test4 (DescriptorTest)" << std::endl;
    
    std::cout << "%TEST_STARTED% test5 (DescriptorTest)\n" << std::endl;
    test5();
    std::cout << "%TEST_FINISHED% time=0 test (DescriptorTest)" << std::endl;
*/
    std::cout << "%SUITE_FINISHED% time=0" << std::endl;

    return (EXIT_SUCCESS);
}

